<?php

namespace App\Services;

use App\Models\CustomerBu;
use Slowlyo\OwlAdmin\Services\AdminService;

/**
 * C业务管理
 *
 * @method CustomerBu getModel()
 * @method CustomerBu|\Illuminate\Database\Query\Builder query()
 */
class CustomerBuService extends AdminService
{
	protected string $modelName = CustomerBu::class;

	public function listQuery()
	{
		return $this->query()->with(['fcustomer', 'sign_company', 'idcnode'])->orderByDesc($this->getModel()->getUpdatedAtColumn());
	}

	
	public function getData($fcustomer_id)
	{
		if ($fcustomer_id) {
			return $this->listQuery()->where('fcustomer_id', $fcustomer_id)->get();
		}else{
			return $this->listQuery()->get();
		}
	}
}